<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="./layui/css/layui.css">
    <link rel="stylesheet" href="./css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body style="background-color: white">
<div class="layui-container" style="text-align: center">
    <c:if test="${not empty outRecord}">
        <h1>客户列表</h1>
        <tip>到期或到期时间小于15天的客户</tip>
        <table border="1" style="text-align: center">
            <tr>
                <th width="80px">客户ID</th>
                <th width="130px">到期时间</th>
                <th width="80px">操作</th>
            </tr>

            <c:forEach items="${outRecord}" var="record">
                <tr>
                    <td>${record.customerId}</td>
                    <td><fmt:formatDate value="${record.maturityDate}" pattern="yyyy-MM-dd"/></td>
                    <td><button class="layui-btn layui-btn-xs layui-btn-radius" name="${record.customerId}" id="${record.customerId}">续费</button></td>
                </tr>
            </c:forEach>
        </table>
    </c:if>
    <c:if test="${ empty outRecord}">
        <h1>无数据</h1>
    </c:if>



</div>
<script src="./layui/layui.js"></script>

<script>
    layui.use(function () {
        var $ = layui.jquery;


        $("button").click(function (event){
          // console.log(event)
          //   alert($(this).attr("name"))
            var index = window.parent.layer.open({
                title: '续费',
                type: 2,
                shade: 0.2,
                // maxmin:true,
                shadeClose: true,
                area: ['700px', '500px'],
                content: './orderAdd',
            });
            $(window).on("resize", function () {
                layer.full(index);
            });
        });


    });


</script>
</body>
</html>